import React, { useState } from 'react';
import MemoView from './reactmemo/MemoView';
// import PureComponentView from './purecomponent/PureComponentView';

const App = () => {
  let [count, setCount] = useState(0)
  let [user, setUser] = useState({ age: 0 })
  return (
    <div>
      <h1>App 根组件---count: {count}</h1>
      <h1>App 根组件---Age: {user.age}</h1>
      <div>
        <button type="button" onClick={() => {
          setCount(count + 1)
        }}>setCount</button>
        <button type="button" onClick={() => {
          // setUser({ ...user, age: user.age + 1 })
          setUser({ ...user, age: 0 })
        }}>setUser</button>
      </div>
      {/* <PureComponentView count={count} user={user} /> */}

      <MemoView count={count} user={user} />

    </div>
  );
}

export default App;
